<?php

use yii\helpers\Html;
use yii\widgets\ActiveForm;
use yii\helpers\ArrayHelper;

/* @var $this yii\web\View */
/* @var $model backend\modules\admin\models\admin */
/* @var $form yii\widgets\ActiveForm */
?>
<div class="card">
    <div class="row">

        <div class="content">

            <div class="col-xs-12">
            <div style="height:20px"></div>
                <?php
                $label_class=['class'=>'col-sm-3 control-label no-padding-right'];
                $form = ActiveForm::begin(
                    [
                        'fieldConfig'=>[
                            'options' => ['enctype' => 'multipart/form-data', 'class' => 'form-horizontal'],
                            'template'=> "<div class=\"form-group\">{label}\n<div class=\"col-sm-5\">{input}</div><div class=\"col-sm-3\">{error}</div></div>",
                            'labelOptions' =>['class' => $label_class],
                        ],
                        'method' => 'post',
                    ]
                );
                ?>

                <?= $form->field($model, 'username')->textInput(['maxlength' => 20,'class'=>'form-control border-input']); ?>
                <?= $form->field($model, 'password')->passwordInput(['maxlength' => 32,'class'=>'form-control border-input']); ?>
                <?= $form->field($model, 'roleid')->dropDownList(ArrayHelper::map($roles,'roleid', 'rolename'));?>
                <?= $form->field($model, 'realname')->textInput(['maxlength' => 50,'class'=>'form-control border-input']) ?>
                <?= $form->field($model, 'tel')->textInput(['maxlength' => 20,'class'=>'form-control border-input']); ?>
                <?= $form->field($model, 'city_id')->dropDownList([1=>'济南市']);?>
                
                <?= $form->field($model, 'department_id')->dropDownList(ArrayHelper::map($department,'dp_id','dp_name'));?>
                <?= $form->field($model, 'isAccept')->dropDownList([1=>'是',0=>'否']);?>
                <div class="clearfix">
                    <div class="col-md-offset-3 col-md-9">
                        <?= Html::submitButton('提交', ['class'=>'btn btn-info','name' =>'submit-button']) ?>
                        <?= Html::resetButton('重置', ['class'=>'btn btn-primary','name' =>'reset-button']) ?>
                    </div>
                </div>



                <?php ActiveForm::end(); ?>
                <div class="space-4"></div>

          </div><!-- /.col -->

         </div><!-- /.content -->
       
    </div><!-- /.row -->
</div><!-- /.card -->

<?php $this->beginBlock('myjs') ?>
    function ajaxGetArea(status=0){
    layer.msg(status);

    return false;
    }
<?php $this->endBlock() ?>
<?php $this->registerJs($this->blocks['myjs'], \yii\web\View::POS_END); ?>